package com.chaopei.customer_server.service.impl;

import com.chaopei.customer_server.service.MyService;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
/**
 * @Author yws
 * @Date 2022/4/26 16:40
 */
@Service
public class MyServiceImpl implements MyService {
    @Resource
    RestTemplate restTemplate;//Rest+Ribbon的实现
    public String getJson(String info) {
        //远程获取另一个服务的接口数据
        return restTemplate.getForObject("http://provider-server/give?info="+info,String.class);
    }
}
